<admintpl file="header" />
<link rel="stylesheet" href="/public/simpleboot/zTree/css/metroStyle/metroStyle.css" type="text/css">
<script type="text/javascript" src="/public/simpleboot/zTree/js/jquery.ztree.core.js"></script>
<script src="__PUBLIC__/js/common.js"></script>
<SCRIPT type="text/javascript">
    var setting = {
        data: {
            simpleData: {
                enable: true,
                idKey: "id",
                pIdKey: "pId",
                rootPId: 0
            }
        },
        callback: {
            onClick: zTreeOnClick
        },
//        view: {
//            fontCss : {color:"red",'size':'70px'}
//        }
//        view: {
//            addDiyDom: addDiyDom
//        }

    };
    function zTreeOnClick(event, treeId, treeNode) {
//        alert(treeNode.tId + treeId+ ", " + treeNode.id);
        if(treeNode.id==1)return;
        art.dialog.open("__ROOT__/index.php?g=portal&m=AdminGroup&a=groupDetail&id=" +treeNode.id, {
            title: treeNode.name+"组织信息",
            width: "95%",
            height:"100%"

        });
    };

//    function addDiyDom(treeId, treeNode) {
//        var aObj = $("#" + treeNode.tId + "_a");
//        if ($("#diyBtn_"+treeNode.id).length>0) return;
//        var editStr = '<a class="btn btn-primary btn-small ">新增</a>';
//        aObj.append(editStr);
//
//         $().bind("click", function(){alert("diy Button for " + treeNode.name);});
//    };

    var nodes = '{$treeNodes}';
    var treeNodes=JSON.parse(nodes);
//    treeNodes=[
//        { id:1, pId:0, name:"展开、折叠 自定义图标不同", open:true, iconOpen:"../../../css/zTreeStyle/img/diy/1_open.png", iconClose:"../../../css/zTreeStyle/img/diy/1_close.png"},
//        { id:11, pId:1, name:"叶子节点1", icon:"/public/simpleboot/zTree/icon/a.jpg"},
//        { id:12, pId:1, name:"叶子节点2", icon:"/public/simpleboot/zTree/icon/b.jpg"},
//        { id:13, pId:1, name:"叶子节点3", icon:"/public/simpleboot/zTree/icon/c.jpg"},
//        { id:2, pId:0, name:"展开、折叠 自定义图标相同", open:true, icon:"../../../css/zTreeStyle/img/diy/4.png"},
//        { id:21, pId:2, name:"叶子节点1", icon:"../../../css/zTreeStyle/img/diy/6.png"},
//        { id:22, pId:2, name:"叶子节点2", icon:"../../../css/zTreeStyle/img/diy/7.png"},
//        { id:23, pId:2, name:"叶子节点3", icon:"../../../css/zTreeStyle/img/diy/8.png"},
//        { id:3, pId:0, name:"不使用自定义图标", open:true },
//        { id:31, pId:3, name:"叶子节点1"},
//        { id:32, pId:3, name:"叶子节点2"},
//        { id:33, pId:3, name:"叶子节点3"}
//
//    ];
//    console.log(treeNodes);


    $(document).ready(function(){
//        $('span.node_name').css('font-size','16px');
        console.log(nodes);
        $.fn.zTree.init($("#treeDemo"), setting,treeNodes);
//        var span1=$('.level0 span').css('background-image',' url("/public/simpleboot/zTree/icon/a.jpg")');
    });
    //-->
</SCRIPT>

</head>
<body>
    <div class="wrap">
        <ul class="nav nav-tabs">
            <li class="active"><a href="#">会员关系</a></li>
        </ul>
        <form class="well form-search" method="get" action="{:U('Portal/AdminUser/relationship')}">
            会员账号：
            <input type="text" name="user_login" style="width: 200px;" value="{:I('request.user_login/s','')}" required placeholder="请输入会员账号">
            <input type="submit" class="btn btn-primary js-ajax-submit" value="提交" />
        </form>
         <div>
            <ul id="treeDemo" class="ztree"></ul>
        </div>

    </div>
    <script src="__PUBLIC__/js/common.js"></script>
</body>
</html>